home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 5 / Amoszine 5.adf / LHA_ARCHIVES / POWERBOBS_DEMO.lha / AZ_POWERBOB_DEMO / POWER_BOBS_DOC_AMOSZINE.ASC < prev    next >
Encoding:
Text File  |  1980-02-10  |  16.4 KB  |  619 lines

  1. Power Bobs doc file. (22/11/1994) AmosZine version !
  2. ====================================================
  3.  
  4. First I want to thank Andy Dobinson for his GREAT idea's !!!!!
  5.  
  6.  
  7.  
  8. The extension is available for :
  9.     Amos Classic : V1.3+
  10.     AMOSPro         : V1.12+
  11.  
  12.  
  13. the full version is availiable by simply sending a cheque or postal order
  14. to the following address....
  15.  
  16.  
  17.                MAGICKINGHT/POWERSOFT productions
  18.                19 NORMAN ROAD
  19.                ILFORD
  20.                ESSEX
  21.  
  22. prices.....      25 pounds + 2.50 p+p+insurance (printed manual)
  23.                    
  24.                  20 pounds + 2.50 P+P+insurance (manual on disk)
  25.  
  26. please make all cheques/po payable to  G.SYMONS
  27.  
  28.  
  29.  
  30.  
  31.  
  32. Installation of this demo
  33. -------------------------
  34.  
  35. IMPORTANT - YOU MUST USE A COPY OF YOUR SYSTEM DISK
  36.             JUST INCASE SOMETHING GOES WRONG
  37.             YOU HAVE BEEN WARNED............ANDY
  38.  
  39.  
  40. FOR AMOS 1.3 users
  41. ------------------
  42.  
  43. 1)   First of all copy the file..... Amos_PowerBobs.Lib ......into your 
  44.      AMOS_SYTEM drawer on your COPY of your system disk
  45.  
  46. 2)   Boot up amos and run the...... CONFIG1_3.AMOS ........... program
  47.  
  48. 3)   select the ...LOAD DEFAULT CONFIGERATION... from the disc menu
  49.  
  50. 4)   click on  .....SET LOADED EXTENSIONS.....from the set menu
  51.  
  52. 5)   click on line 13 of the list thats displayed and enter following
  53.      exactly....
  54.      
  55.      AMOS_SYSTEM/Amos_PowerBobs.Lib
  56.      
  57. 6)   select quit
  58.  
  59. 7)   select.......... SAVE CONFIGERATION .........from the disc menu
  60.  
  61. 8)   dont forget to change .....AMOS1_3_NTSC and RAMOS1_3.ENV ...files
  62.      using the same method as above
  63.      
  64. 9)   select QUIT and reboot     
  65.      
  66. AMOS PRO
  67. --------
  68.  
  69. 1) copy the ...... AMOSPro_PowerBobs.Lib ..... into you APSystem directory
  70.  
  71. 2) select set interpreter and then selectload default configeration
  72.  
  73. 3) select set loaded extensions and click on line 13 and enter the 
  74.    line exactly
  75.    
  76.    AMOSPro_PowerBobs.Lib
  77.    
  78. 4) select save default configeration and reboot....
  79.  
  80.    
  81. For BEST speed, programs are to compiled!!!
  82.  
  83. Beware ! Several commands have changed read the whole docfile !!!
  84.  
  85. New commands.
  86. -------------
  87.  
  88. Main PowerBob commands.
  89. -----------------------
  90.  
  91. Reserve Pbobs
  92.  
  93. Reserve Pbobs AMOUNT
  94.  Reserves a static memory list for AMOUNT of Pbobs.
  95.  You can reserve a list for a maximum of 64 Pbobs.
  96.  I can change this if you want more of them, but 64 seems to be
  97.  enough for most applications...
  98.  
  99.  Bytes reserved : AMOUNT * 8
  100.  
  101.  Type of memory : Chip or Fast if available.
  102.  
  103.  
  104. Pbob Erase
  105.  
  106. Pbob Erase
  107.  Erase all Pbobs and their structure. This instruction is executed 
  108.  internally every time you run the AMOS/Pro program or when leaving 
  109.  AMOS/Pro.
  110.  
  111.  
  112. Pbob Dbuf
  113.  
  114. Pbob Dbuf True/False
  115.  If you are going to use Pbobs with the double buffering system, set it
  116.  to True. Else set it to False.
  117.  This command MUST preceed all following commands !
  118.  
  119.  
  120. Pbob Height
  121.  
  122. Pbob Height NR,MAXIMUM_HEIGHT
  123.  Reserves a PBOB_STRUCTURE for Pbob NR and initialises it with default
  124.  values.
  125.  If Pbob Dbuf is set to True, a second PBOB_STRUCTURE will be reserved
  126.  for use with the double buffering system.
  127.  
  128.  Bytes reserved : PBOB_STRUCTURE        Chip or Fast if available.
  129.           MAXIMUM_HEIGHT * 36     Chip
  130.           \--> 6 bytes for each line to save * 6 bitplanes.
  131.           (See Pbob instruction for more details)
  132.           If Pbob Dbuf is set to True, the amount of bytes reserved
  133.           is doubled.
  134.  
  135.  
  136. Pbob
  137.  
  138. Pbob NR,X,Y,IMAGE
  139.  Does almost the same thing as the normal Bob command.
  140.  The only differences are :
  141.  1) the maximum width of the IMAGE is 32 pixels wide.
  142.     There are no restrictions on the height of the Pbob.
  143.  
  144.  2) the height of the IMAGE that will be displayed may NOT exceed
  145.     the maximum height for this Pbob.
  146.     See the Pbob Height command.
  147.  
  148.  3) the amount of colours of the IMAGE may NOT exceed the amount
  149.     of screen colours where the Pbob will be displayed.
  150.     Else a crash is certain!
  151.     So if you open a screen with 4 colours, do not try to display a Pbob
  152.     with 8 or more colours...
  153.  
  154.  4) all parameters must be included.
  155.     This will change in the future...
  156.  
  157.  5) the Pbob numbering starts at 1, not 0 like the AMOS/Pro Bobs...
  158.  
  159.  6) it is important to know that the coordinates for the Pbob's are
  160.     measured from the top left-hand corner of the image.
  161.     The current hot spot setting in not taken into account!
  162.  
  163.  7) the Pbob commands have to be executed in the screen where they are
  164.     to be displayed !
  165.     This is because a part of the Clipping routine is done inside the
  166.     Pbob command.
  167.     Ex.:
  168.     Repeat
  169.           Screen 1
  170.        Proc UPDATE_SCORE
  171.        Screen 0
  172.        Proc MOVE_BADDIES : Rem move the BAD_GUYS with Pbob NR,X,Y,IMAGE
  173.        Proc MOVE_GOODIE : Rem  move the GOOD_GUYS with Pbob NR,X,Y,IMAGE
  174.        Proc UPDATE_BADDIES_AND_GOODIES : Rem Pbob Clear : Pbob Draw : Screen Swap : Wait Vbl
  175.     Until AMOUNT_OF_GOODIES=0
  176.  
  177. Pbob ARRAY_X,ARRAY_Y,ARRAY_IMAGE,START_BOB To END_BOB
  178.  This is a superfast replacement for the original Pbob command.
  179.  Normally you have to define all Pbob's whithin a loop like this :
  180.     
  181.   For I=START_BOB To END_BOB
  182.     Pbob I,ARRAY_X(I),ARRAY_Y(I),ARRAY_IMAGE(I)
  183.   Next I
  184.  
  185.  This loop can be replaced with one command !
  186.  
  187.   Pbob Varptr(ARRAY_X(0)),Varptr(ARRAY_Y(0)),Varptr(ARRAY_IMAGE(0)),START_BOB To END_BOB
  188.  
  189.  It has been carefully optimised to give the best speed possible!
  190.  A few tests, normally done by the usual Pbob command, have been
  191.  ommited.
  192.   1) It does not check if the Pbob IMAGE is wider than 32 pixels.
  193.   2) It does not check if the HEIGHT of the Pbob IMAGE exceeds the
  194.      maximum height for this Pbob.
  195.   3) Also the lenght of the ARRAY's are not checked for !
  196.  
  197.  So I advise you to test your program in the usual manner and, if 
  198.  everything works fine, you can use the new version of the Pbob
  199.  command.
  200.  
  201.  
  202. Pbob Off
  203.  
  204. Pbob Off NR
  205.  Does the same thing as the Amos Bob Off NR command...
  206.  
  207. Pbob Off START To END
  208.  Discard a range of Pbobs.
  209.  
  210. Pbob Off
  211.  Does the same thing as the Amos Bob Off command...
  212.  
  213.  
  214. Set Pbob
  215.  
  216. Set Pbob NR,REPLACE_MODE,PLANEMASK
  217.  Set Pbob drawing mode.
  218.  There are two types of REPLACE_MODE :
  219.    1) a value of 0 will save and restore the background under your Pbob,
  220.       this is the default value.
  221.    2) any other value will turn off the save and restore process.
  222.  
  223. The PLANEMASK is a bit-map, defining which plane(s) of the Pbob will be
  224.  copied onto the screen.
  225.  If a bit is set to zero, this particular plane of the Pbob will not
  226.  be copied onto the screen.
  227.  Ex.: Set Pbob 1,0,%100001  --> copy plane 6 and 1 onto the screen.
  228.           plane 654321
  229.  
  230.  
  231. Pbob Update
  232.  
  233. Pbob Update
  234.  Does the same thing as the Amos Bob Update command, except that
  235.  the Logical and Physical Screens are not swapped.
  236.  This allows a better control on the updating process if you are using
  237.  multiple double buffered screens.
  238.  
  239.  
  240. Pbob Clear 
  241.  
  242. Pbob Clear START_BOB To END_BOB
  243.  Clear a range of Pbobs by restoring the original background.
  244.  
  245.  
  246. Pbob Draw 
  247.  
  248. Pbob Draw START_BOB To END_BOB
  249.  Draw a range of Pbobs on screen.
  250.  
  251.  
  252. Pdraw 25fps
  253.  
  254. Pdraw 25fps
  255.  Set the Pbob Clear and Pbob Draw command in 25 frames per second
  256.  mode.
  257.  When you run your program, it is allways reset to 50 frames per second!
  258.  Beware, this mode does not influence the Pbob Update command!
  259.  
  260.  In ProjectX and Alien Breed and quite a lot of other games, the main
  261.  Sprite etc., is updated at 50 frames per second, but the Bobs are only
  262.  updated at 25 frames per second.
  263.  So the program looks like this:
  264.  
  265. DO 
  266. `
  267. A=1-A : rem a simple toggle 1st frame = 1, next frame =0  etc
  268. `
  269. `
  270. READ JOYSTICK AND STUFF EVERY FRAME
  271. `
  272. `
  273. If A=1
  274.    CLEAR ALL BOBS
  275. `
  276.    Pbob Clear 1 To 20
  277.  
  278.    CALCULATE NEW POSTIONS FOR BOBS 11 TO 20
  279. `
  280.    Pbob DRAW 11 TO 20 
  281.    ETC.......
  282. `
  283. Else
  284. `
  285.    CALCALCULATE NEW POSTIONS FOR BOBS 1 TO 10
  286. `
  287.    Pbob Draw 1 TO 10
  288.    ETC.....
  289. '
  290.    Screen Swap 
  291. '
  292. End If
  293. 'UPDATE MAIN SPRITE EVERY FRAME
  294. Sprite 0,X,Y,3
  295. Wait Vbl
  296. Loop
  297.  
  298. As you can see, Pbobs 11 to 20 are drawn in the first frame.
  299. The next frame, Pbobs 1 to 10 are drawn and screen swapped into view.
  300. But the joystick reading and anything else are updated every frame!
  301.  
  302.  
  303. Pswap Clear
  304.  In the old Pbob Clear command the background buffer adresses where
  305.  swapped inside the Pbob Clear command.
  306.  Normally you used to do :
  307.      Pbob Clear
  308.     Screen Swap
  309.     Pbob Clear
  310.  
  311.  The new way is :
  312.     Pbob Clear START_BOB To END_BOB
  313.     Screen Swap
  314.     Pswap Clear
  315.     Pbob Clear START_BOB To END_BOB
  316.  
  317.  
  318. PowerBob Amal support.
  319. ----------------------
  320.  
  321. Pchannel To Pbob
  322.  
  323. Pchannel To Pbob AMAL_CHANNEL To PBOB_NR
  324.  Assigns Pbob PBOB_NR to Channel AMAL_CHANNEL.
  325.  As normal with Amal programs, the X/Y and A variables define the
  326.  Pbob X/Y coordinates and it's image.
  327.  It is important to assign the channel(s) to the Pbob(s) after the
  328.  Amal CHAN_NR,ANIM$
  329.  
  330.  
  331. Psync Pbob
  332.  
  333. Psync Pbob START_BOB To END_BOB
  334.  It does the same thing as the Amos/Pro Synchro command, but as an
  335.  additional bonus a range of Pbobs can be updated, this is :
  336.  the new X/Y and A values are transferred to the Pbobs.
  337.  It whas also necessary to include a range to be compatible with the
  338.  new 25 frames per second mode.
  339.  You still have to call the Pbob Update or the Pbob Clear/Draw duo
  340.  to update your Pbobs on screen.
  341.  Beware ! The Psync Pbob command has to be executed in the screen 
  342.  where the Pbobs are to be displayed !
  343.  This is because a part of the Clipping routine is done inside the
  344.  Psync Pbob command.
  345.  
  346.  
  347. Psync Every
  348.  
  349. Psync Every FRAME_COUNT
  350.  Normally the Psync Pbob transfers the X/Y and A values every time the
  351.  Psync Pbob command is called, this is the default mode.
  352.  In some occasions it is preferable to update these values at a slower
  353.  rate.  The FRAME_COUNT delay ranges from 1 to 32767.
  354.  
  355.  
  356. PowerBob functions.
  357. -------------------
  358.  
  359. =I Pbob()
  360.  
  361. IMAGE=I Pbob(NR)
  362.  Return the actual image for Pbob NR.
  363.  
  364.  
  365. =X Pbob()
  366.  
  367. X=X Pbob(NR)
  368.  Return X coordinate of Pbob NR.
  369.  
  370.  
  371. =Y Pbob()
  372.  
  373. Y=Pbob Y(NR)
  374.  Return Y coordinate of Pbob NR. 
  375.  
  376.  
  377. =Pbob Fastcol()
  378.  
  379. RESULT=Pbob Fastcol(BOB,STARTBOB To ENDBOB)
  380.  Does the same thing as the Bob Col function except that I use
  381.  coordinate checking.
  382.  This method is much faster than using the BLITTER to check if a
  383.  collision has occured, but is not so accurate.
  384.  It can be used even if the BOB's have no mask.
  385.  A Pbob Finecol function, which uses the BLITTER, will be available soon.
  386.  
  387. RESULT=Pbob Fastcol(BOB To OTHER_BOB)
  388.  This one is handy if you want to detect a collision between two BOB's.
  389.  It does the same thing as Pbob Fastcol(BOB,OTHER_BOB To OTHER_BOB) but
  390.  is a bit faster.
  391.  Since you are only checking for collision between one BOB and another BOB,
  392.  the flag in the collision array is not set.
  393.  This means that the Pfast Col() function is useless in this case.
  394.   
  395.  
  396. =Pbobsprite Fastcol()
  397.  
  398. RESULT=Pbobsprite Fastcol(BOB,STARTSPRITE To ENDSPRITE)
  399.  Does the same thing as the Bobsprite Col function except that I use
  400.  coordinate checking.
  401.  This method is much faster than using the BLITTER to check if a
  402.  collision has occured, but is not so accurate.
  403.  It can be used even if the BOB's have no mask.
  404.  A Pbobsprite Finecol function, which uses the BLITTER, will be available
  405.  soon.
  406.  
  407. RESULT=Pbobsprite Fastcol(BOB To SPRITE)
  408.  This one is handy if you want to detect a collision between a BOB and
  409.  one SPRITE.
  410.  It does the same thing as Pbobsprite Fastcol(BOB,SPRITE To SPRITE) but
  411.  is a bit faster.
  412.  Since you are only checking for collision between one BOB and another SPRITE,
  413.  the flag in the collision array is not set.
  414.  This means that the Pfast Col() function is useless in this case.
  415.  
  416.  
  417. =Pfast Col()
  418.  
  419. NR=Pfast Col(BOB_NR or SPRITE_NR)
  420.  Does the same thing as the Col(BOB_NR or SPRITE_NR) function in AMOS/Pro.
  421.  To be used when doing FAST collision detection.
  422.  
  423.  
  424.  
  425. Main PowerSprite commands.
  426. --------------------------
  427.  
  428. Convert Sprites
  429.  
  430. Convert Sprites BANKNR
  431.  Convert all Sprites in bank BANKNR to special hardware format.
  432.  As you know, Bob's and Sprites share the same format in memory.
  433.  Normally, when displaying a Sprite, it has to be converted into the
  434.  special hardware format (interleaved bitplane format), before it
  435.  can be displayed by the Sprite DMA-channels.
  436.  The Psprite commands skip this conversion giving an enormous speed-gain!
  437.  It is best to keep you Sprites and Bobs into separate banks, because
  438.  this command will convert all Bobs/Sprites in the bank, wasting a lot
  439.  of your precious memory !
  440.  At this moment the conversion works fine for 4 coloured Sprites
  441.  that are 16 pixels wide, any height is allowed.
  442.  
  443.  
  444. Psprite Max
  445.  
  446. Psprite Max AMOUNT
  447.  Set the maximum amount of Psprites that will be used.
  448.  A maximum of 128 Psprites is allowed !
  449.  
  450.  
  451. Psprite NR,X,Y,IMAGE
  452.  Does the same thing as the AMOS/Pro command.
  453.  All parameters must be given !
  454.  
  455. Psprite Off
  456.  
  457. Psprite Off NR
  458.  Does the same thing as the Amos/Pro Sprite Off NR command...
  459.  
  460. Psprite Off START To END
  461.  Discard a range of Psprites.
  462.  
  463. Psprite Off
  464.  Does the same thing as the Amos/Pro Sprite Off command...
  465.  
  466.  
  467. Psprite Update
  468.  
  469. Psprite Update
  470.  This is a very powerfull updating command.
  471.  First it checks if the maximum amount of Psprites <= 8, if so
  472.  the Psprite images are copied directly to their corresponding
  473.  sprite DMA-channels.
  474.  
  475.  If the maximum amount of Psprites >8 and the number of actually
  476.  defined sprites with the Psprite command is <=8, the Psprite images
  477.  are copied directly to the sprite DMA-channels without sorting.
  478.  
  479.  In any other case the Psprites are first sorted on their Y-coordinates.
  480.  Then every Psprite is checked if it can be fitted in a particular
  481.  sprite DMA-channel.
  482.  It is possible to have 128 Psprites on screen using only 1 sprite 
  483.  DMA-channel!  (ever seen those demos with super smooth starfields)
  484.  
  485.  
  486. PowerSprite functions.
  487. ----------------------
  488.  
  489. =X Psprite()
  490.  
  491. HARD_XCOOR=X Psprite(NR)
  492.  Returns the actual hardware X coordinate for Psprite NR
  493.  
  494.  
  495. =Y Psprite()
  496.  
  497. HARD_YCOOR=Y Psprite(NR)
  498.  Returns the actual hardware Y coordinate for Psprite NR
  499.  
  500.  
  501.  
  502. Additional commands.
  503. ====================
  504.  
  505. =Xscr Sprite()
  506.  
  507. XSCREEN_COORD=Xscr Sprite(NR)
  508.  This is a full replacement for XSCREEN_COORD=X Screen(X Sprite(NR)).
  509.  
  510.  
  511. =Yscr Sprite()
  512.  
  513. YSCREEN_COORD=Yscr Sprite(NR)
  514.  This is a full replacement for YSCREEN_COORD=Y Screen(Y Sprite(NR)).
  515.  
  516.  
  517. =Xscr Mouse
  518.  
  519. XSCREEN_COORD=Xscr Mouse
  520.  This is a full replacement for XSCREEN_COORD=X Screen(X Mouse).
  521.  
  522.  
  523. =Yscr Mouse
  524.  
  525. YSCREEN_COORD=Yscr Mouse
  526.  This is a full replacement for YSCREEN_COORD=Y Screen(Y Mouse).
  527.  
  528.  
  529. Additional information.
  530. -----------------------
  531.  
  532. Since this extension is still growing and changing, I advise you to
  533. save all your programs in ASCII format with separate graphic banks.
  534. You are warned !!!
  535.  
  536.  
  537. The Pbob Update command :
  538.  The updating process is divided into 3 stages.
  539.  1) Background replacement.
  540.  
  541.  2) Background saving.
  542.     This is only done if the X/Y coordinates or the Pbob IMAGE width/height
  543.     have changed since the last update.
  544.  
  545.  3) Image drawing.
  546.     This is performed every time for all Pbob's.
  547.  
  548. The Pbob Clear command :
  549.  The background is replaced every time for all Pbob's from their
  550.  safe places.
  551.  
  552. The Pbob Draw command :
  553.  The drawing process is divided into 2 stages.
  554.  1) Define the area where the Pbob's will be displayed and
  555.     copy this area to a safe place.
  556.  2) Draw the images for all Pbob's.
  557.  
  558. So the Pbob Clear/Draw should be used when a lot of changes are done
  559. onto the screen.
  560.  Ex.:
  561.     Do
  562.        Pbob Clear START_BOB To END_BOB
  563.        'do all other drawing stuff...
  564.        Pbob Draw START_BOB To END_BOB
  565.     Loop
  566.  
  567.  
  568. Problem solving :
  569. -----------------
  570.  
  571. The Pbob's are scrambled on screen :
  572.  Be sure that the following commands are executed on the screen you want
  573.  to display them.
  574.  1) Pbob NR,X,Y,IMAGE
  575.  2) the Pbob Clear and Pbob Draw duo.
  576.  3) the Pbob Update command.
  577.  4) the Psync Pbob command.
  578.  
  579. The Pbob's disappear at certain X/Y coordinates :
  580.  Be sure to execute the Pbob commands on the screen you will display them.
  581.  A part of the Clipping routine is done by the Pbob/Psync Pbob command!
  582.  
  583. The Pbob's don't appear on screen :
  584.  Are you using a double buffered screen, and you haven't set the
  585.  Pbob Dbuf flag to True ?
  586.  
  587. The Pbob's leave traces on screen :
  588.  Are you using a single buffered screen, and you haven't set the
  589.  Pbob Dbuf flag to False ?
  590.  
  591. The Pbob's don't appear on a double buffered screen, even when the
  592. Pbob Dbuf flag is set to True :
  593.  Have you set the Autoback system to 0 or 1 ?
  594.  The Pbob's are only displayed on the Logical screen, so a
  595.  Screen Swap has to be put somewhere in your program.
  596.  Remember ! The Pbob Update command does NOT swap the Logical and
  597.  Physical screens.
  598.  
  599. Your program crashes when using the Pbob system :
  600.  Put your program on disk and send it to the publisher for
  601.  investigation of the problem.
  602.  
  603.  
  604. Future commands/enhancements.
  605. -----------------------------
  606.  
  607.  
  608. RESULT=Pbob Finecol(BOB,START_BOB To ENDBOB)
  609.  Do collision detection with the BLITTER.
  610.  
  611. RESULT=Pbob Finecol(BOB To OTHER_BOB)
  612.  Do collision detection with the BLITTER.
  613.  
  614. NR=Pfine Col(BOB_NR)
  615.  Does the same thing as the Col(BOB_NR) function in AMOS/Pro.
  616.  To be used when doing FINE collision detection.
  617.  
  618.  
  619.